<?php
include_once("ExtArray.php");

class Column
{
	public $name;
	public $type;
	public $size;
	public $isPrimary;
	public $references;
	
	public function __construct()
	{
		$this->references = new EArray();
	}
	
	public function name($val)
	{
		$this->name = $val;
		return $this;
	}
	
	public function type($val)
	{
		$this->type = $val;
		return $this;
	}
	
	public function size($val)
	{
		$this->size = $val;
		return $this;
	}
	
	public function isPrimary($val)
	{
		$this->isPrimary = $val;
		return $this;
	}
	
	public function has_reference_to($table, $col)
	{
		$reference = new Reference();
		$reference->table = $table;
		$reference->column = $col;
		$this->references->append($reference);
	}
}

class Reference
{
	public $table;
	public $column;
}
?>